import { defineStore } from "pinia";
import router from "../m-router/router_tool";

 const useCountStore=defineStore('medical',{
   
    state(){
        return{
            isCollapse:false,
            selectmenu:[]
        }
    },  
    actions:{
         getisCollapse(state:any){
            state.isCollapse=!state.isCollapse
            console.log(state.isCollapse)
        },
        addSelectmenu(state:any,statenow:any){
            if(state.selectmenu.findIndex((item: { path: string; }) => item.path == statenow.path)==-1){
                state.selectmenu.push(statenow)
            }else{
                console.log('重复添加');
                
            }
        },
        deleteSelectmenu(state:any,statenow:any){
            const index=state.selectmenu.findIndex((item: { path: string; }) => item.path == statenow.path)
            state.selectmenu.splice(index,1)
            return index
        },
        dynamicMenu(data,payload){
    
            
          const data1=import.meta.glob('../m-components/**/**/*.vue')

          console.log(data1);
          
        }

    },



    
})
export default useCountStore
